<script>

onload = function() {
	y_html = document.getElementById('y_section').innerHTML
	m_html = document.getElementById('m_section').innerHTML
	d_html = document.getElementById('d_section').innerHTML
	p_html = document.getElementById('p_section').innerHTML

	y_section = document.getElementById('y_section')
	m_section = document.getElementById('m_section')
	d_section = document.getElementById('d_section')
	p_section = document.getElementById('p_section')
	s_btn = document.getElementById('submit_btn')

	<? if ($show_range==1) { ?>
		y_section.innerHTML = "" 
		m_section.innerHTML = ""
		d_section.innerHTML = ""
		p_section.innerHTML = ""
		s_btn.style.visibility = 'visible'	
	<? } ?>
	<? if ($show_range==2) { ?>
		//y_section.innerHTML = "" 
		m_section.innerHTML = ""
		d_section.innerHTML = ""
		s_btn.style.visibility = 'visible'	
	<? } ?>
	<? if ($show_range==3) { ?>
		//y_section.innerHTML = "" 
		//m_section.innerHTML = ""
		d_section.innerHTML = ""
		s_btn.style.visibility = 'visible'	
	<? } ?>
	df = document.forms[0]
	};
	
function toggleMe(val) {

	s_btn.style.visibility = 'visible'
	
	if (val==0) {
		y_section.innerHTML = ""
		m_section.innerHTML = ""
		d_section.innerHTML = ""
		s_btn.style.visibility = 'hidden'
	}
	if (val==1) {
		y_section.innerHTML = ""; y_section.style.visibility = 'hidden'
		m_section.innerHTML = "";m_section.style.visibility = 'hidden'
		d_section.innerHTML = "";d_section.style.visibility = 'hidden'
		p_section.innerHTML = "";p_section.style.visibility = 'hidden'
		df.action = '?act=stat_outing_yearly&output=<?=$output?>'
	}
	if (val==2) {
		y_section.innerHTML = y_html; y_section.style.visibility = 'visible'
		m_section.innerHTML = ""; m_section.style.visibility = 'hidden'
		d_section.innerHTML = "";d_section.style.visibility = 'hidden'
		df.action = '?act=stat_outing_monthly&output=<?=$output?>'
	}
	if (val==3) {
		y_section.innerHTML = y_html; y_section.style.visibility = 'visible'
		m_section.innerHTML = m_html;m_section.style.visibility = 'visible'
		d_section.innerHTML = "";d_section.style.visibility = 'hidden'
		df.action = '?act=stat_outing_daily&output=<?=$output?>'
	}
	//alert(val);
}
</script>

<form name="date_form" id="date_form" method="post" action="?act=<?=$_REQUEST['act']?>&output=statistic">

		  Bilangan Sekolah Mengikut <?=$ikut_apa?> bagi Negeri
		  <span id="y_section" style=" visibility:<?=(($show_range==2)||($show_range==3))?"visible":"visible"?>">
		      <!-- Tahun  -->
		      <select name="negeri" id="negeri" onchange="">
              <?
				$combo   = new GUI();
				$options = getOptionsFromTable('states','id','description');
				print_r($option);
				//$options = $_years;
				echo $combo->printCombo2($options, "negeri",false, "$negeri",false,0);

			  ?>
              </select>
  </span>
			  
		      <input type="submit" name="submit_btn" id="submit_btn" value="Papar" style="visibility:<?=($show_range==0)?"visible":"visible"?>" class="button">
</form>